package com.ice.work.moment.facade.crawler.enums;

/**
 * @Description 机构持仓爬取字段
 * @Author DELL
 * @Create 2019-01-09
 * @Since 1.0.0
 */
@SuppressWarnings("all")
public enum InstitutionalPositionEnum {

    CLOSE_AT(2, "closeAt", "截止日期"),
    SHARE_CODE(0, "shareCode", "股票代码"),
    INSTITUTIONAL_NUMBER(3, "institutionalNumber", "持有家数"),
    TOTAL_POSITIO_NNUMBER(5, "totalPositionNumber", "持股总数(万股)"),
    POSITION_RATE(6, "positionRate", "占总股本比例%"),
    CHANGE_POSITION_NUMBER(8, "changePositionNumber", "持股变动数值(万股)"),
    CHANGE_RATE(9, "changeRate", "持股变动比例%");

    public Integer key;
    public String code;
    public String remark;

    InstitutionalPositionEnum(Integer key, String code, String remark) {
        this.key = key;
        this.code = code;
        this.remark = remark;
    }

    public static String getCodeByKey(Integer key) {
        for (InstitutionalPositionEnum gender : InstitutionalPositionEnum.values()) {
            if (gender.key.equals(key)) {
                return gender.code;
            }
        }
        return null;
    }
}
